/**
 * 
 */
package com.dfhc.pub.service;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.quickbundle.project.IGlobalConstants;
import org.springframework.ui.Model;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import bsh.EvalError;

import com.dfhc.ISystemConstant;
import com.dfhc.bus.generalservice.vo.GeneralServiceVo;

/**
 * 通用业务扩展，
 * 适用范围：基于模板表：BUS_GENERAL_SERVICE，操作业务，通用的GeneralSerivce无法满足，需要个性化业务操作
 * 则需要实现该类，覆盖对应方法，然后在实现类配置注解： 
 * @Service("com.dfhc.xxx.TestService")  
 * public class TestService extends ExtGeneralService {
 *  }  
 * 如果 GeneralServiceDao不能满足，则需要另实现dao(建议继承GeneralServiceDao,只实现个性化方法即可)和xml
 * 
 * @author longsebo
 */
public  class ExtGeneralService implements IExtGeneralService,IGlobalConstants {

	/* (non-Javadoc)
	 * @see com.dfhc.pub.service.IExtGeneralService#doSaveBusinessData(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	@Override
	public Map<String, Object> doSaveBusinessData(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.dfhc.pub.service.IExtGeneralService#doSaveBusinessDataAndFiles(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, com.dfhc.bus.generalservice.vo.GeneralServiceVo, java.util.List)
	 */
	@Override
	public Map<String, Object> doSaveBusinessDataAndFiles(
			HttpServletRequest request, HttpServletResponse response,
			GeneralServiceVo vo, List listFile) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.dfhc.pub.service.IExtGeneralService#doSaveTaskData(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	@Override
	public Map<String, Object> doSaveTaskData(HttpServletRequest request,
			HttpServletResponse response) throws EvalError {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.dfhc.pub.service.IExtGeneralService#exportXls(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	@Override
	public void exportXls(HttpServletRequest request,
			HttpServletResponse response) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see com.dfhc.pub.service.IExtGeneralService#getBusinessData(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest)
	 */
	@Override
	public Map<String, Object> getBusinessData(String id,
			String businessTableName, HttpServletRequest request) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.dfhc.pub.service.IExtGeneralService#readBusinessData(javax.servlet.http.HttpServletRequest)
	 */
	@Override
	public Map<String, Object> readBusinessData(HttpServletRequest request) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.dfhc.pub.service.IExtGeneralService#readTaskData(javax.servlet.http.HttpServletRequest)
	 */
	@Override
	public Map<String, Object> readTaskData(HttpServletRequest request) {
		// TODO Auto-generated method stub
		return null;
	}
	/* (non-Javadoc)
	 * @see com.dfhc.pub.service.IExtGeneralService#ajaxList(Model model,javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	@Override
	public void ajaxList(Model model, HttpServletRequest request,HttpServletResponse response) throws IOException  {
	}
	protected  Map<String, Object> getQueryCondition(HttpServletRequest request) {
        Map<String, Object> searchMap = null;
        if(request.getAttribute(REQUEST_QUERY_CONDITION) != null) {  //如果request.getAttribute中有，就不取request.getParameter
            searchMap = (Map<String, Object>)request.getAttribute(REQUEST_QUERY_CONDITION);
        } else {
           searchMap = new HashMap<String, Object>();
           searchMap.put("id", request.getParameter("id"));
           searchMap.put("businessGroup", request.getParameter("businessGroup"));
           searchMap.put("parentId", request.getParameter("parentId"));
           searchMap.put("businessAttribute70", request.getParameter("businessAttribute70"));
           searchMap.put("businessAttribute69", request.getParameter("businessAttribute69"));
           searchMap.put("businessAttribute68", request.getParameter("businessAttribute68"));
           searchMap.put("businessAttribute67", request.getParameter("businessAttribute67"));
           searchMap.put("businessAttribute66", request.getParameter("businessAttribute66"));
           searchMap.put("businessAttribute65", request.getParameter("businessAttribute65"));
           searchMap.put("businessAttribute64", request.getParameter("businessAttribute64"));
           searchMap.put("businessAttribute63", request.getParameter("businessAttribute63"));
           searchMap.put("businessAttribute62", request.getParameter("businessAttribute62"));
           searchMap.put("businessAttribute61", request.getParameter("businessAttribute61"));
           searchMap.put("businessAttribute60", request.getParameter("businessAttribute60"));
           searchMap.put("businessAttribute59", request.getParameter("businessAttribute59"));
           searchMap.put("businessAttribute58", request.getParameter("businessAttribute58"));
           searchMap.put("businessAttribute57", request.getParameter("businessAttribute57"));
           searchMap.put("businessAttribute56", request.getParameter("businessAttribute56"));
           searchMap.put("businessAttribute55", request.getParameter("businessAttribute55"));
           searchMap.put("businessAttribute54", request.getParameter("businessAttribute54"));
           searchMap.put("businessAttribute53", request.getParameter("businessAttribute53"));
           searchMap.put("businessAttribute52", request.getParameter("businessAttribute52"));
           searchMap.put("businessAttribute51", request.getParameter("businessAttribute51"));
           searchMap.put("businessAttribute50", request.getParameter("businessAttribute50"));
           searchMap.put("businessAttribute49", request.getParameter("businessAttribute49"));
           searchMap.put("businessAttribute48", request.getParameter("businessAttribute48"));
           searchMap.put("businessAttribute47", request.getParameter("businessAttribute47"));
           searchMap.put("businessAttribute46", request.getParameter("businessAttribute46"));
           searchMap.put("businessAttribute45", request.getParameter("businessAttribute45"));
           searchMap.put("businessAttribute44", request.getParameter("businessAttribute44"));
           searchMap.put("businessAttribute43", request.getParameter("businessAttribute43"));
           searchMap.put("businessAttribute42", request.getParameter("businessAttribute42"));
           searchMap.put("businessAttribute41", request.getParameter("businessAttribute41"));
           searchMap.put("businessAttribute40", request.getParameter("businessAttribute40"));
           searchMap.put("businessAttribute39", request.getParameter("businessAttribute39"));
           searchMap.put("businessAttribute38", request.getParameter("businessAttribute38"));
           searchMap.put("businessAttribute37", request.getParameter("businessAttribute37"));
           searchMap.put("businessAttribute36", request.getParameter("businessAttribute36"));
           searchMap.put("businessAttribute35", request.getParameter("businessAttribute35"));
           searchMap.put("businessAttribute34", request.getParameter("businessAttribute34"));
           searchMap.put("businessAttribute33", request.getParameter("businessAttribute33"));
           searchMap.put("businessAttribute32", request.getParameter("businessAttribute32"));
           searchMap.put("businessAttribute31", request.getParameter("businessAttribute31"));
           searchMap.put("businessAttribute30", request.getParameter("businessAttribute30"));
           searchMap.put("businessAttribute29", request.getParameter("businessAttribute29"));
           searchMap.put("businessAttribute28", request.getParameter("businessAttribute28"));
           searchMap.put("businessAttribute27", request.getParameter("businessAttribute27"));
           searchMap.put("businessAttribute26", request.getParameter("businessAttribute26"));
           searchMap.put("businessAttribute25", request.getParameter("businessAttribute25"));
           searchMap.put("businessAttribute24", request.getParameter("businessAttribute24"));
           searchMap.put("businessAttribute23", request.getParameter("businessAttribute23"));
           searchMap.put("businessAttribute22", request.getParameter("businessAttribute22"));
           searchMap.put("businessAttribute21", request.getParameter("businessAttribute21"));
           searchMap.put("businessAttribute20", request.getParameter("businessAttribute20"));
           searchMap.put("businessAttribute19", request.getParameter("businessAttribute19"));
           searchMap.put("businessAttribute18", request.getParameter("businessAttribute18"));
           searchMap.put("businessAttribute17", request.getParameter("businessAttribute17"));
           searchMap.put("businessAttribute16", request.getParameter("businessAttribute16"));
           searchMap.put("businessAttribute15", request.getParameter("businessAttribute15"));
           searchMap.put("businessAttribute14", request.getParameter("businessAttribute14"));
           searchMap.put("businessAttribute13", request.getParameter("businessAttribute13"));
           searchMap.put("businessAttribute12", request.getParameter("businessAttribute12"));
           searchMap.put("businessAttribute11", request.getParameter("businessAttribute11"));
           searchMap.put("businessAttribute10", request.getParameter("businessAttribute10"));
           searchMap.put("businessAttribute9", request.getParameter("businessAttribute9"));
           searchMap.put("businessAttribute8", request.getParameter("businessAttribute8"));
           searchMap.put("businessAttribute7", request.getParameter("businessAttribute7"));
           searchMap.put("businessAttribute6", request.getParameter("businessAttribute6"));
           searchMap.put("businessAttribute5", request.getParameter("businessAttribute5"));
           searchMap.put("businessAttribute4", request.getParameter("businessAttribute4"));
           searchMap.put("businessAttribute3", request.getParameter("businessAttribute3"));
           searchMap.put("businessAttribute1", request.getParameter("businessAttribute1"));
           searchMap.put("businessAttribute2", request.getParameter("businessAttribute2"));
           searchMap.put("delete_flag",ISystemConstant.DICTIONARY_RM_YES_NOT_0);
           searchMap.put(ISystemConstant.PREDEFINED_BUSINESS_TABLENAME,request.getParameter(ISystemConstant.PREDEFINED_BUSINESS_TABLENAME));
        }
        return searchMap;
    }

	@Override
	public Map<String, Object> doAjaxInsert(HttpServletRequest request,
			GeneralServiceVo vo) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Map<String, Object> doAjaxUpdate(HttpServletRequest request,
			GeneralServiceVo vo) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Map<String, Object> ajaxGet(String id, String businessTableName,
			HttpServletRequest request) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String delete(HttpServletRequest request,
			RedirectAttributes redirectAttributes) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Map<String, Object> doAjaxDelete(HttpServletRequest request) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String doLogicDelete(HttpServletRequest request,
			RedirectAttributes redirectAttributes) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String detail(String id, Model model, HttpServletRequest request) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void exportXls(Model model, HttpServletRequest request,
			HttpServletResponse response) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void importXls(HttpServletRequest request,
			HttpServletResponse response) {
		// TODO Auto-generated method stub
		
	}
}
